//
//  ExpressViewController.m
//  Hello
//
//  Created by Detailscool on 16/3/17.
//  Copyright © 2016年 Detailscool. All rights reserved.
//

#import "ExpressViewController.h"
#import "QRCodeViewController.h"

@interface ExpressViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *neighborExpressImageView;
@property (weak, nonatomic) IBOutlet UIButton *helpCollectionButton;
@property (weak, nonatomic) IBOutlet UILabel *helpCollectionLabel;
@property (weak, nonatomic) IBOutlet UILabel *neighborCollecitonLabel;
@property (weak, nonatomic) IBOutlet UIImageView *noExpressImageView;

@end

@implementation ExpressViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupBasic];
    
}

- (void)setupBasic {
    
    self.helpCollectionButton.layer.cornerRadius = 5;
    self.helpCollectionButton.layer.masksToBounds = YES;
    
    self.navigationItem.title = @"haha";
    self.view.backgroundColor = GlobalColor;
    
    UIButton * signInButton = [[UIButton alloc]init];
    [signInButton setBackgroundImage:[UIImage imageNamed:@"sign_in"] forState:UIControlStateNormal];
    signInButton.width = 20;
    signInButton.height = 20;
    [signInButton addTarget:self action:@selector(signInButtonClick) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * signInItem = [[UIBarButtonItem alloc]initWithCustomView:signInButton];
    self.navigationItem.rightBarButtonItem = signInItem;
    
}

- (void)signInButtonClick {
    
    QRCodeViewController * qrVC = [[QRCodeViewController alloc]init];
    [self.navigationController pushViewController:qrVC animated:YES];
    
}


- (IBAction)segmentValueChanged:(UISegmentedControl *)sender {
    
    self.neighborExpressImageView.hidden = !sender.selectedSegmentIndex;
    self.helpCollectionButton.hidden = !sender.selectedSegmentIndex;
    self.helpCollectionLabel.hidden = !sender.selectedSegmentIndex;
    self.neighborCollecitonLabel.hidden = sender.selectedSegmentIndex;
    self.noExpressImageView.hidden = sender.selectedSegmentIndex;
    
}

@end
